// Account Model
import { Model } from "@vuex-orm/core";
import User from "./User";
export default class Account extends Model {
  // This is the name used as module name of the Vuex Store.
  static entity = "accounts";

  static primaryKey = "id";

  // List of all fields (schema) of the post model. `this.attr` is used
  // for the generic field type. The argument is the default value.
  static fields() {
    return {
      id: this.attr(null),
      username: this.string(""),
      email: this.string(""),
      auth: this.boolean(true),
      password: this.attr(""),
      salt: this.attr(""),
      user: this.hasOne(User, "account_id")
    };
  }
}
